#include <iostream>
#include <string>
using namespace std;

int arr[10005][30] = { 0 };
int num = 0;
int tmp[30] = { 0 };
bool find() {
	for (int i = 0;i < num;i++) {
		for (int j = 0;j < 26;j++) {
			if (tmp[j] == arr[i][j])
				continue;
			else {
				goto end;
			}
		}
		return true;
	end:;
	}
	for (int i = 0;i < 26;i++) {
		arr[num][i] = tmp[i];
	}
	num++;
	return false;
}

int main()
{
	int n;
	cin >> n;
	for (int i = 0;i < n;i++) {
		string str;
		cin >> str;
		for (int j = 0;j < 26;j++)
			tmp[j] = 0;
		for (int j = 0;j < str.length();j++) {
			tmp[str[j] - 'A']++;
		}
		bool ans = find();
	}
	cout << num << endl;
	return 0;
}